<?php
/**
 *
 * @authors  Ysg (y.shi.guo@gmail.com)
 * @website  http://ysg.bonza.cn
 * @date     2017-08-10 16:23:41
 */

class AudioPlayer implements MediaPlayer
{
	private $mediaPlayer = null;

    function __construct()
    {
    }
    public function play($type)
    {
    	$arr = explode('.',$type);
    	$type = strtolower(end($arr));
    	switch ($type) {
    		case 'mp3':
		    	echo "播放：".$type;
    			break;
    		case 'mp4':
		    	$this->mediaPlayer = new MediaAdapter($type);
		    	$this->mediaPlayer->play($type);
    			break;
    		case 'vlc':
		    	$this->mediaPlayer = new MediaAdapter($type);
		    	$this->mediaPlayer->play($type);
    			break;

    		default:
    			echo "不能播放的格式";
    			# code...
    			break;
    	}
    }

}
